import { Fetch } from './request';

function parseToPromise(res:any):Fetch<any, any> {
  return (p?:any) => new Promise((resolve) => {
    setTimeout(() => {
      resolve(res);
    }, 100);
  });
}

export default {
  index() {
    return parseToPromise({
      retCode: 0,
      retMsg: '请求成功',
      data: {
        user_id: 40042,
        workspace: '/root/wide/workspaces/40042',
        locale: 'zh_CN',
        go_format: 'gofmt',
        go_build_args: '-i',
        font_family: 'Helvetica',
        font_size: '14px',
        theme: 'dark',
        keymap: 'wide',
        editor_font_family: "Consolas, 'Courier New', monospace",
        editorFontSize: '14px',
        editorLineHeight: '14px',
        editor_theme: 'monokai',
        editor_tab_size: '4'
      }
    });
  },
  get() {
    return parseToPromise({
      retCode: 0,
      retMsg: '请求成功',
      data: {
        name: '杭州新中大科技股份有限公司',
        uin: '308000000687',
        nickname: '1457013549@qq.com',
        secretId: 's40042',
        secretKey: '8d90ce3e1116f748f218e94f76b2538b93f023a9259e28f2ae62cefa5e255301',
        manager: '田钟',
        mobile: '15372027307',
        email: '1457013549@qq.com',
        idCard: '421024199508233819',
        creditCode: '91330000712535433D',
        representativeName: '石钟韶',
        registerTime: '2022-03-10 15:14:48'
      }
    });
  }
};
